@import '@/styles/token';

.themeColorPanel {
  padding: 0;

  .panelTitle {
    margin: 0 0 @paddingSm 0;
    font-size: @fontSizeLg;
    font-weight: @fontWeightStrong;
    color: @colorText;
  }
}

.presetColorsSection {
  margin-bottom: @paddingMd;
}

.presetColorsGrid {
  display: flex;
  flex-wrap: wrap;
  gap: @paddingSm;
  margin-top: @paddingSm;
  justify-content: flex-start;
}

.colorPreviewItem {
  height: 40px;
  width: 40px;
  cursor: pointer;
  box-sizing: content-box;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.3s @motionEaseOut;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;

  .colorPreviewItemSolid {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
  }

  &:hover {
    border-color: var(--hover-border-color, @colorPrimary);
  }

  &.active {
    border-color: @colorPrimary;
  }
}

.colorPreviewItemContainer {
  position: relative;
  cursor: pointer;

  &:hover {
    .colorPreviewItemText {
      opacity: 1 !important;
    }
  }
}

.customColorPickerIcon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  z-index: 2;
  transform: translate(-50%, -50%);
}

.colorPreviewItemText {
  margin-top: @marginXxs;
  display: block;
  font-size: @fontSizeSm; // 使用更小的字号
  color: @colorTextSecondary;
  text-align: center;
  white-space: nowrap;
  line-height: @lineHeight;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: normal;
  opacity: 0;
}

.customColorSection {
  display: flex;
  justify-content: center;

  .customColorPicker {
    margin-top: 0;
    border: none;
    transition: all 0.3s @motionEaseOut;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      box-shadow: none;
    }

    :global {
      .ant-color-picker-color-block {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
      }

      .ant-color-picker-trigger-text {
        margin: 0;
        margin-inline-start: 0;
        margin-inline-end: 0;
      }
    }
  }
}
